;;; -*- Mode: Midas -*-
;;; Copyright (c) 1999 Massachusetts Institute of Technology
;;;
;;; This program is free software; you can redistribute it and/or
;;; modify it under the terms of the GNU General Public License as
;;; published by the Free Software Foundation; either version 3 of the
;;; License, or (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
;;; General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program; if not, see https://gnu.org/licenses or
;;; write to:
;;;  Free Software Foundatiom, Inc.
;;;  51 Franklin St, Fifth Floor
;;;  Boston, MA 02110-1301
;;;  USA

.AUXIL

;;; Canonical symbol definition macro, FOO==BAR with error check.
IFNDEF DEFSYM,[	
DEFINE DEFSYM X/
IRPS Z,,[X]
IFNDEF Z,X
.ELSE [	$$TEM1==Z
	X
	IFN Z-$$TEM1,.ERR Z MULTIPLY .QUOTE`.QUOTE/DEFINED/`
      ]
.ISTOP
TERMIN TERMIN
$$TEMP==1
] ;IFNDEF DEFSYM
.ELSE, $$TEMP==0


;;; RH11/TM03 Interrupt vector:
DEFSYM	%TMVEC==224		;(224/4 = 45) Interrupts occur on level 6
				; (high priority) on UBA #1.
DEFSYM	%TMBAS==772400		;Unibus address of first register 

;;; RH11/TM03 Unibus register addresses:

DEFSYM	%TMCS1=:%TMBAS		;CONTROL AND STATUS 1
 DEFSYM	%TM1SC==1_15.		; Special Condition
 DEFSYM	%TM1TE==1_14.		; Transfer Error
 DEFSYM	%TM1MP==1_13.		; Massbus Control Bus Parity Error
 DEFSYM	%TM1DA==1_11.		; Drive Available
 DEFSYM	%TM1A7==1_9.		; UB Address Extension Bit 17
 DEFSYM	%TM1A6==1_8.		; UB Address Extension Bit 16
 DEFSYM	%TM1RY==1_7.		; Ready
 DEFSYM	%TM1IE==1_6.		; Interrupt Enable
 DEFSYM	$TM1CM==.BP 77		; Bits 0-5 specify commands.
 DEFSYM	%TM1GO==1_0.		; GO bit

;;; Commands with bit 0 (GO) included:

DEFSYM	%TMNOP==1		;No Operation
DEFSYM	%TMUNL==3		;Unload
DEFSYM	%TMREW==7		;Rewind
DEFSYM	%TMCLR==11		;Formatter clear (reset errors etc.)
DEFSYM	%TMER3==25		;Erase three inch gap
DEFSYM	%TMWTM==27		;Write Tape Mark
DEFSYM	%TMSPF==31		;Space Forward
DEFSYM	%TMSPR==33		;Space Reverse
DEFSYM	%TMWCF==51		;Write Check FOrward
DEFSYM	%TMWCR==57		;Write Check Reverse
DEFSYM	%TMWRT==61		;Write Forward
DEFSYM	%TMRDF==71		;Read Forward
DEFSYM	%TMRDR==77		;Read Data Reverse

DEFSYM	%TMWC=:%TMBAS+2		;WORD COUNT.

DEFSYM	%TMBA=:%TMBAS+4		;UNIBUS ADDRESS.

DEFSYM	%TMFC=:%TMBAS+6		;TAPE FRAME COUNT

DEFSYM	%TMCS2=:%TMBAS+10	;CONTROL AND STATUS 2.
 DEFSYM	%TM2DL==1_15.		; Data Late
 DEFSYM	%TM2UP==1_13.		; Unibus Parity Error
 DEFSYM	%TM2NF==1_12.		; Non-existant Formatter
 DEFSYM	%TM2NM==1_11.		; %TMBA is NXM during DMA
 DEFSYM	%TM2PE==1_10.		; Program Error
 DEFSYM	%TM2MT==1_9.		; Missed Transfer
 DEFSYM	%TM2MP==1_8.		; Massbus Data Bus Parity Error
 DEFSYM	%TM2OR==1_7.		; Output Ready (for Silo buffer diag.)
 DEFSYM	%TM2IR==1_6.		; Input  Ready (for Silo buffer diag.)
 DEFSYM	%TM2CC==1_5.		; Controller Clear
 DEFSYM	%TM2PT==1_4.		; Parity Test
 DEFSYM	%TM2AI==1_3.		; Unibus Address Increment Inhibit

DEFSYM	%TMFS=:%TMBAS+12	;FORMATTER STATUS
 DEFSYM	%TMSAA==1_15.		; Attention Active
 DEFSYM	%TMSES==1_14.		; Error Summary
 DEFSYM	%TMSPP==1_13.		; Positioning in Progress
 DEFSYM	%TMSOL==1_12.		; Medium On-Line
 DEFSYM	%TMSWL==1_11.		; Write Locked
 DEFSYM	%TMSET==1_10.		; End of Tape
 DEFSYM	%TMSFP==1_8.		; Formatter Present
 DEFSYM	%TMSFR==1_7.		; Formatter Ready
 DEFSYM	%TMSSC==1_6		; Slave Status Change
 DEFSYM	%TMSPE==1_5.		; Phase Encoded (1600BPI) Mode
 DEFSYM	%TMSSD==1_4.		; Slowing Down
 DEFSYM	%TMSIB==1_3.		; PE Identification Burst Detected
 DEFSYM	%TMSTM==1_2.		; Tape Mark detected
 DEFSYM	%TMSBT==1_1.		; Beginning of Tape
 DEFSYM	%TMSSA==1_0.		; Slave Attention (on-line)

DEFSYM	%TMERR=:%TMBAS+14	;ERROR REGISTER
 DEFSYM	%TMECE==1_15.		; Correctable Data/CRC Error
 DEFSYM	%TMEUS==1_14.		; Unsafe
 DEFSYM	%TMEOI==1_13.		; Operation Incomplete
 DEFSYM	%TMECT==1_12.		; Controller Timing Error
 DEFSYM	%TMENX==1_11.		; Non Executable Function
 DEFSYM	%TMECS==1_10.		; Correctable Skew/Illegal Tape Mark Error
 DEFSYM	%TMEFC==1_9.		; Frame Count Error
 DEFSYM	%TMENG==1_8.		; Non-standard Gap
 DEFSYM	%TMEFL==1_7.		; PE Format/LRC Error
 DEFSYM	%TMEIC==1_6.		; Incorrectable Data/Hard Error
 DEFSYM	%TMEMD==1_5.		; Massbus Data Parity Error
 DEFSYM	%TMEFS==1_4.		; Format Select Error
 DEFSYM	%TMEMC==1_3.		; Massbus Control Parity Error
 DEFSYM	%TMERM==1_2.		; Register Modification Refused
 DEFSYM	%TMEIR==1_1.		; Illegal Register
 DEFSYM	%TMEIF==1_0.		; Illegal Function
  DEFSYM %TMEHD==44077		; Hard errors - US,NX,MD,FS,MC,RM,IR,IF

DEFSYM	%TMASN=:%TMBAS+16	;ATTENTION SUMMARY.
	;Each bit 7-0 corresponds to a formatter asserting ATA.

DEFSYM	%TMCCR=:%TMBAS+20	;CHECK CHARACTER REGISTER
 DEFSYM %TMCDP==1_8.		; Dead Track Parity/CRC Parity
 DEFSYM $TMCEI==.BP 177		; Error Information

DEFSYM	%TMBUF=:%TMBAS+22	;DATA BUFFER REGISTER

DEFSYM	%TMMNT=:%TMBAS+24	;MAINTENANCE.

DEFSYM	%TMTYP=:%TMBAS+26	;DRIVE TYPE.
				;2.7  Not Sector addressed
				;2.6  Tape
				;2.5  Moving Head
				;2.3  Dual controller option available
				;1.9 - 1.1  Drive Type Number.
				;   TU77=14, TU45=12, TE16=11 Nothing=10

DEFSYM	%TMSER=:%TMBAS+30	;SERIAL NUMBER

DEFSYM	%TMTC=:%TMBAS+32	;TAPE CONTROL REGISTER
 DEFSYM	%TMTAC==1_15.		; Acceleration (not up to speed)
 DEFSYM %TMTFC==1_14.		; Frame Count non-zero
 DEFSYM %TMTSA==1_13.		; Slave Address (selected slave) Changed
 DEFSYM %TMTEA==1_12.		; Enable Abort on data transfer error
 DEFSYM %TMTDS==7_8.		; Density Select Field
 DEFSYM $TMTDS==.BP %TMTDS
  DEFSYM %TMD08==3		;  800 BPI NRZI
  DEFSYM %TMD16==4		;  1600 BPI PE
 DEFSYM %TMTFS==17_4.		; Format Select
 DEFSYM $TMTFS==.BP %TMTFS
  DEFSYM %TMFCD==0		;  PDP10 Core Dump
  DEFSYM %TMFIC==3		;  Industry Compatible (32 bit mode)
 DEFSYM %TMTEP==1_3.		; Even Parity
 DEFSYM %TMTTS==7		; Transport Select
 DEFSYM $TMTTS==.BP %TMTTS

IFN $$TEMP,EXPUNG DEFSYM


